package com.tanhua.domain.mongo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "soul_test")
public class Soul implements Serializable {
    private ObjectId id;//id
    private String name;//试卷名字
    private String cover;//试卷封面
    private String level;//试卷等级
    private Integer star;//试卷难度星级
    private List<Questions> questions;//试题
    private Integer isLock;//试卷是否解锁
    private ObjectId reportId;//最新报告id

    public void addSoulId(List<Questions> questions,ObjectId id){
        for (Questions question : questions) {
            question.setSoulId(id);
        }
    }
}
